<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui"
                template="../templates/principal.xhtml">

    <ui:define name="content" id="content">
        
        <p:ajaxStatus onstart="PF('statusDialog').show();" onsuccess="PF('statusDialog').hide();"/>

        <p:dialog modal="true" widgetVar="statusDialog" header="Aguarde ... Processando ..." draggable="false" closable="false">
            <p:graphicImage value="/design/ajaxloadingbar.gif" />
        </p:dialog>

        <h:form id="frmRelProcesso" prependId="false" target="_blank">
            <p:growl id="messages" life="5000" />
            
            <div id="limites">
                <div id="conteudo">
                    <p:panel id="panel" header="Bem Vindo ao Relatório de Processos">
                        <div align="center">
                            <h:panelGrid id="display" columns="2" style="margin-bottom:50px" cellpadding="5" columnClasses="coluna1, coluna2">
                                <h:outputText value="Tipo:" />
                                <p:selectOneMenu id="tipStatus" value="#{processoBean.statusRel}" style="width: 200px;">
                                    <f:selectItem itemLabel="Escolha o Status" itemValue="" />
                                    <f:selectItem itemLabel="Em Andamento" itemValue="A" />
                                    <f:selectItem itemLabel="Finalizado" itemValue="F" />
                                    <f:selectItem itemLabel="Não Contratado" itemValue="N" />
                                    <f:selectItem itemLabel="Todos" itemValue="T" />
                                </p:selectOneMenu>

                                <h:outputText value="Situação:" />
                                <p:selectOneMenu id="tipSituacao" value="#{processoBean.situacaoRel}" style="width: 200px;">
                                    <f:selectItem itemLabel="Escolha a Situação" itemValue="" />
                                    <f:selectItem itemLabel="Deferido" itemValue="D" />
                                    <f:selectItem itemLabel="Indeferido" itemValue="I" />
                                    <f:selectItem itemLabel="Em Analise" itemValue="A" />
                                    <f:selectItem itemLabel="Todos" itemValue="T" />
                                </p:selectOneMenu>

                                <h:outputText value="Ordenação:" />
                                <p:selectOneMenu id="tipOrder" value="#{processoBean.orderRel}" style="width: 200px;">
                                    <f:selectItem itemLabel="Escolha a Ordenação" itemValue="" />
                                    <f:selectItem itemLabel="Razão Social // Nome" itemValue="R" />
                                    <f:selectItem itemLabel="Nome Fantasia // Sobrenome" itemValue="F" />
                                    <f:selectItem itemLabel="Descrição Empreendimento" itemValue="E" />
                                </p:selectOneMenu>

                                
                                <p:commandButton value="Imprimir Relatório" update=":frmRelProcesso:panel :frmRelProcesso:messages"
                                 ajax="false"
                                 onclick="submit_automatico2('#{request.contextPath}/relatorio', 'frmRelProcesso');" />
                            </h:panelGrid>
                        </div>
                    </p:panel>
                </div>
            </div>
            <h:inputHidden id="tipRel" value="processo" />
        </h:form>
    </ui:define>
</ui:composition>